package com.atguigu.observer.demo3;

public class Test {

    public static void main(String[] args) {

        //主题
        WeatherData weatherData = new WeatherData();
        
        //实例化观察者，并传入主题
        QQWebSite qq = new QQWebSite(weatherData);
        BaiduWebSite baidu = new BaiduWebSite(weatherData);
        
        //每次改变温度时，都会通知观察者更新输出。
        weatherData.setTemperature(20);
        weatherData.setTemperature(22);
    }     
}